"""scodepub URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from app01.views import server
from stack.service.stack import site
from app01.views import project
from app01.views import deploytask
from app01.views import hooktemplate
urlpatterns = [
    path('admin/', admin.site.urls),
    path('stack/',site.urls),   #stack组件注册urls

    path('server/list/',server.ServerListView.as_view(),name='server_list'),    #服务器的查看视图
    path('server/add/',server.ServerAddView.as_view(),name='server_add'),   #服务器的添加视图
    path('server/edit/<int:pk>/',server.ServerEditView.as_view(),name='server_edit'),   #服务器的编辑视图
    path('server/delete/<int:pk>/',server.ServerDeleteView.as_view(),name='server_delete'),  #服务器的删除的视图

    path('project/list/',project.ProjectListView.as_view(),name='project_list'),    #项目的查看视图
    path('project/add/',project.ProjectAddView.as_view(),name='project_add'),   #项目的添加视图
    path('project/edit/<int:pk>/',project.ProjectEditView.as_view(),name='project_edit'),   #项目的编辑视图
    path('project/delete/<int:pk>/',project.ProjectDeleteView.as_view(),name='project_delete'),  #项目的删除的视图

    path('deploytask/list/<int:pid>/',deploytask.DeployTaskListView.as_view(),name='deploytask_list'),  #任务发布 查看视图
    path('deploytask/add/<int:pid>/',deploytask.DelpoyTaskAddView.as_view(),name='deploytask_add'),  #任务发布 查看视图
    path('deploytask/edit/<int:pid>/<int:pk>/',deploytask.DelpoyTaskEditView.as_view(),name='deploytask_edit'),  #任务发布 编辑视图
    path('deploytask/delete/<int:pid>/<int:pk>/',deploytask.DelpoyTaskDeleteView.as_view(),name='deploytask_delete'),  #任务发布 删除视图

    path('hooktemplate/detail/<int:pk>/',hooktemplate.HookTemplateDetailView.as_view(),name='hooktemplate_detial'),#钩子模板函数的具体获取获取视图

    path('deploytask/deploy/<int:pk>/',deploytask.DeployTaskDeployView.as_view(),name='deploytask_deploy'),       #任务发布的 发布实时展示视图

    # #### websocket 请求
    # path('publish/<int:pk>/'),

]

